package com.qf.controller;

import com.qf.Resp.BaseResp;
import com.qf.goods.Goods;
import com.qf.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author H
 * @create 2020-11-03 11:47
 * @strive To be whoever you want to be.
 * @Description:
 */
@RestController
public class GoodsController {

    @Autowired
    GoodsService goodsService;

    @RequestMapping("/findAllGoods")
    public BaseResp findAllGoods() {
        return goodsService.findAllGoods();
    }

    @RequestMapping("/findById")
    public Goods findById(@RequestParam("id") Integer id) {
        return goodsService.findById(id);
    }
}
